<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>毕业论文管理系统</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
<link rel="shortcut icon"
	href="${pageContext.request.contextPath }/favicon.ico"
	type="${pageContext.request.contextPath }/image/x-icon" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/css/font.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/css/xadmin.css">
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/jquery-3.3.1.min.js"></script>
<script src="${pageContext.request.contextPath }/lib/layui/layui.js"
	charset="utf-8"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/xadmin.js"></script>
<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
<!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
	<div class="x-body">
		<fieldset class="layui-elem-field">
			<legend>发布我的选题</legend>
			<br />
			<br />
			<form class="layui-form" action="">
				<div class="layui-form-item">
					<label class="layui-form-label">论文题目</label>
					<div class="layui-input-block">
						<input type="text" name="title" style="width: 92%;" required
							lay-verify="required" placeholder="请输入标题" autocomplete="off"
							class="layui-input">
						<input type="hidden" name="publish_no" value="${teacher.no }">
					</div>
				</div>
				<br />
				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label">论题简介</label>
					<div class="layui-input-block" style="width: 84.3%;">
						<textarea name="introduction" placeholder="请输入内容" class="layui-textarea"></textarea>
					</div>
				</div>
				<div class="layui-form-item">
					<br />
					<div class="layui-input-block">
						<input value="提交" lay-submit lay-filter="publish" class="layui-btn" type="submit">
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
			</form>
			<br />
		</fieldset>
	</div>
</body>
<script>
$(function  () {
    layui.use('form', function(){
          var form = layui.form;
          // layer.msg('玩命卖萌中', function(){
          //   //关闭后的操作
          //   });
          //监听提交
          form.on('submit(publish)', function(data){
            //alert(888)
             $.ajax({
        		url : "${pageContext.request.contextPath }/teacher/publishTopic.do",
        		type : "post", 
        		data : JSON.stringify(data.field),
        		contentType : "application/json;charset=UTF-8",
        		dataType : "json",
        		//成功响应的结果
        		success : function(data){
        			if(data != null){					
        				layer.msg(data.msg,{time:2000});
        			}
        		}
          	}); 
            return false;
    	});
    });
})
</script>
</html>